finding derivatives of functions